{"componentChunkName":"component---src-templates-blog-template-js","path":"/blog/git-for-beginners","result":{"data":{"markdownRemark":{"html":"<p>I've added some info to our internal Confluence wiki for new devs who don't have a git background. That group included me a year ago so I recall how much of a mind shift it is from a centralised VCS.</p>\n<p>Here are my notes/links for future ref (as much by me as anyone else).</p>\n<h4>SSH:</h4>\n<p>Once you have set up your account on BitBucket, follow the steps on <a href=\"https://confluence.atlassian.com/bitbucket/set-up-ssh-for-git-728138079.html\" target=\"_blank\" rel=\"noopener noreferrer\">Bitbucket</a> (dropping down \"Set up SSH for Windows\") to step up SSH. I would stop at step 6 as at that point you can clone the repos.</p>\n<h4>Configure git</h4>\n<h4>Mandatory. In git bash:</h4>\n<pre><code>git config --global user.email \\[your email\\]\ngit config --global user.name \\[your name\\]\n</code></pre>\n<h4>Optional:</h4>\n<ul>\n<li>Set your favourite mergetool for merging: git config --global merge.tool \"winmerge\". You can see a list of which suitable tools you currently have installed by running: <code>git mergetool --tool-help</code></li>\n<li>Create an alias for a customised version of git log (usage : git lg): <code>git config --global alias.lg \"log --pretty=' %Cred%h%Creset | %C(yellow)%d%Creset %s %Cgreen(%cr)%Creset %Ccyan%Creset' --graph\"</code></li>\n<li>Improves git diff tool: <code>git config --global diff.algorithm histogram</code></li>\n<li>Make merge issues show the base file before conflicts as well as the actual conflicts: <code>git config --global merge.conflictStyle diff3</code></li>\n<li>Configure Git-Bash (if you intend on using it) to point to your local repository file path by default each time it loads up</li>\n<li>Right click on the Git Bash.exe shortcut and click Properties.</li>\n<li>In the Shortcut Tab, enter your local Git repository path in the \"Start In\" textbox. For example, <code>C:\\\\Git</code></li>\n<li>If present, remove the <code>--cd-to-home</code> text from the Target path as this effectively overrides the 'Start In' path</li>\n</ul>\n<h4>Learning git</h4>\n<ul>\n<li><a href=\"http://rogerdudler.github.io/git-guide/\" target=\"_blank\" rel=\"noopener noreferrer\">is a overview of the basics</a></li>\n<li><a href=\"https://www.atlassian.com/git/tutorials/learn-git-with-bitbucket-cloud\" target=\"_blank\" rel=\"noopener noreferrer\">a tutorial you can follow and do</a></li>\n<li><a href=\"./gitexample.html\">A very simple git branching and merging example</a></li>\n<li><a href=\"http://ohshitgit.com/\" target=\"_blank\" rel=\"noopener noreferrer\">a get-out-of-trouble guide</a>.</li>\n<li><a href=\"https://saraford.net/category/github-tip-of-the-day-2017/\" target=\"_blank\" rel=\"noopener noreferrer\">has 128 tips of the day about git</a>, possibly more details that you need initially but the final post in the series has a selection of the best tips.</li>\n<li><a href=\"https://github.com/k88hudson/git-flight-rules\" target=\"_blank\" rel=\"noopener noreferrer\">Flight rules, basically a list of <em>How do I?</em>s.</a></li>\n<li><a href=\"https://git-scm.com/book/en/v2\" target=\"_blank\" rel=\"noopener noreferrer\">A book on git (available in full on this page)</a></li>\n<li><a href=\"https://git-scm.com/doc\" target=\"_blank\" rel=\"noopener noreferrer\">Git docs</a></li>\n</ul>\n<p>There are two tools to help you get to grips with branching (with live testbeds):</p>\n<ul>\n<li><a href=\"https://saraford.net/2017/03/22/how-to-demystify-git-commands-using-visualizing-git/\" target=\"_blank\" rel=\"noopener noreferrer\">Sara Ford's git visualilser</a> (or <a href=\"http://git-school.github.io/visualizing-git/\" target=\"_blank\" rel=\"noopener noreferrer\">http://git-school.github.io/visualizing-git/</a>).</li>\n<li><a href=\"http://learngitbranching.js.org\" target=\"_blank\" rel=\"noopener noreferrer\">Learning git branching</a></li>\n</ul>","frontmatter":{"date":"July 12, 2017","slug":"/blog/git-for-beginners","title":"Git for beginners"}}},"pageContext":{"slug":"/blog/git-for-beginners"}},"staticQueryHashes":["3649515864"]}